// components/subxd/subxd.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    ptbss: {
      type: Object,
      value: {
        id: '0',
        over_num:'',
        sub_note:'',
        title: '',
        picture: '',
        checked: false
      }
    },
    index: {
      type: Number,
      value: 0
    },
    editable: {
      type: Boolean,
      value: false,
    },
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    //选中和取消
    onDfTap(e) {
      let { editable, ptbss } = this.data

      let checked = ptbss.checked;
      checked = !checked;

      let ptbss2 = Object.assign({}, ptbss, { checked });

      if (!editable) return
      this.setData({
        ptbss: ptbss2
      })
      this.triggerEvent('custometapdf', this.data.ptbss);  //把checked更新到页面中

    },
  }
})
